/**
 * Created by tangqiaojie <2482366539@qq.com> on 2020/3/30 0030
 */

import { nextTick } from '../../lib/utils.js';
import {sendSbList} from "./tool.js"

const saveTableDetail = (tableContent) => {
  window.postMessage(
    {
      event: 'asyncTableDetail',
      data: tableContent
    },
    '*'
  );
};

const sendTableDetail = (tableContent) => {
  window.postMessage(
    {
      event: 'asyncTableDetailRequest'
    },
    '*'
  );
};

const saveTable=(title,html)=>{
  let declareType="";
  let tableContent = {
    declareType:title,
    title,
    html,
    css:`table{position:relative;}table{font-family:"微软雅黑";border-collapse:collapse;border-spacing:0;width:90%;margin:0 auto;font-size:12px;}table.border{border-left:1px solid #000;border-top:1px solid #000;}table.border th,table.border td{border-right:1px solid #000;border-bottom:1px solid #000;padding:1px;word-break:break-all;}`
  };
  saveTableDetail(tableContent);
};


export {
  saveTable,
  sendTableDetail
};
